package com.algernoon.rpc.springrpc.rmi.hessian;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.algernoon.rpc.springrpc.entity.User;

@RestController
public class HessianRmiController {

	Logger logger = LoggerFactory.getLogger(HessianRmiController.class);
	
	@Autowired
	private IHessianUserService hessianUserService;
	
	@GetMapping("/hessian/rmi/user/{id}")
	@ResponseBody
	public User findUserById(@PathVariable Integer id) {
		logger.info("[findUserById] request param id is {}.", id);
		return hessianUserService.findUserById(id);
	}
	
}
